ass Solution {
public:
    string compressString(string S) {
        string ret;
        int cur=0;
        int next=1;
        int count=1;
        for(int cur=0;cur<S.size();cur++,next++)
        {
            if(S[cur]==S[next])
            {
                count++;
                //cur 循环的时候++
            }
            else
            {
                ret+=S[cur];
                ret+=to_string(count);
                count=1;
            }
        }
        if(ret.size()>=S.size())
        {
            return S;
        }
        else
        {
            return ret;
        }
    }
};

class Solution {
public:
    vector<string> uncommonFromSentences(string s1, string s2) {
        //合并
        string obj = s1+' '+s2+' ';//后面加了一个' '是取巧后面的判断
        vector<string> count;
        string tmp;
        for(int i=0;i<obj.size();i++)
        {
            if(obj[i]!=' ')
            {
                tmp+=obj[i];
            }
            else
            {
                count.push_back(tmp);
                tmp.clear();
            }
        }
        //计算出现一次
        map<string,int> mp;
        for(auto e:count)
        {
            mp[e]++;
        }
        count.clear();
        for(auto e:mp)
        {
            if(e.second==1)
            {
                count.push_back(e.first);
            }
        }
        return count;
    }
};
